<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数据双向绑定原理</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
<div id="app">
<!--    <input type="text" :value="myInput" @input="myInput=$event.target.value">-->
        <input type="text" :value="myInput" @input="updateData">
</div>
<script>
    const app = Vue.createApp({
        data(){
            return {
                myInput: 'hello'
            }
        },
        methods:{
            updateData(evt){
                console.log('更新数据', evt.target.value);
                this.myInput = evt.target.value;
            }
        }
    }).mount('#app')
</script>

</body>
</html>